package com.cafuc.base;

import java.io.*;
import java.security.PublicKey;

public class ExceptionOperation {
    public void exceptionTest(){
        //double a = 1 / 0;
        File file;
        InputStream is = null;
        try {
            is = new FileInputStream("E:\\temp\\temp1.txt");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }finally {
            try {
                if(is != null){
                    is.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public void exceptionTest2() throws Exception {
        throw new Exception("抛出一个异常");
    }
    public static void main (String[] args) throws Exception {
        ExceptionOperation eo = new ExceptionOperation();
        eo.exceptionTest();
        eo.exceptionTest2();
    }
}
